﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:KazhOo.Sack.Controls.WPF"
                    >


    <Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>
    <Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>
    <Color x:Key="ControlLightColor">White</Color>
    <Color x:Key="BorderMediumColor">#FF888888</Color>

    <SolidColorBrush x:Key="OuterBorderBrush" Color="#30000000" />
    <SolidColorBrush x:Key="InnerBorderBrush" Color="#E0FFFFFF" />
    
    <Style x:Key="PathTextBlockFocused" TargetType="{x:Type Controls:BreadcrumbBar}">
        <Setter Property="Template">
            <Setter.Value>
                <Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type Controls:BreadcrumbBar}}}">
                    <TextBox
                                Text="{Binding Path=Path.ParsingName, Mode=OneWay}" 
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch" 
                                Background="Red"
                                />
                </Grid>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="{x:Type Controls:BreadcrumbBar}" >
        <Setter Property="Focusable" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource PathTextBlockFocused}" />
        <Setter Property="Padding" Value="1" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>

                    <Border x:Name="outerBorder" 
                                    SnapsToDevicePixels="True"
                                    BorderBrush="{StaticResource OuterBorderBrush}" 
                                    BorderThickness="1" 
                                    CornerRadius="3,3,3,3"
                                    Background="{x:Null}" 
                                    Focusable="False"
                                    >

                        <Border x:Name="innerBorder"
                                    SnapsToDevicePixels="True"
								    BorderBrush="{StaticResource InnerBorderBrush}"
								    BorderThickness="1"
								    CornerRadius="2,2,2,2"
								    Background="{x:Null}" 
                                    Focusable="False"
                                    >

                            <Grid x:Name="rootGrid"
                                        Margin="0"
                                        Focusable="False"
                                        DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type Controls:BreadcrumbBar}}}"
                                        >

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <ProgressBar x:Name="PART_Progress"
                                            Grid.Column="0"
                                            Grid.ColumnSpan="4"
                                            Background="Transparent"
                                            BorderThickness="0"
                                            Maximum="{Binding ProgressMaximum,RelativeSource={RelativeSource TemplatedParent}}" 
                                            Minimum="{Binding ProgressMinimum,RelativeSource={RelativeSource TemplatedParent}}" 
                                            Value="{Binding ProgressValue,RelativeSource={RelativeSource TemplatedParent}}" 
                                            />

                                <ComboBox x:Name="PART_ComboBox"                                             
                                            Grid.Column="0"
                                            Grid.ColumnSpan="3"
                                            Visibility="Hidden"
                                            Margin="0,0,0,0"
                                            IsEditable="True"
                                            Focusable="True"
                                            BorderThickness="0"
                                            />

                                <!--ItemTemplate="{TemplateBinding DropDownItemTemplate}"
                                          ItemTemplateSelector="{TemplateBinding DropDownItemTemplateSelector}"
                                          ItemsSource="{Binding DropDownItems,RelativeSource={RelativeSource TemplatedParent}}"
                                          SelectedIndex="{Binding SelectedDropDownIndex,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"-->

                                <Button x:Name="PART_Root"
                                            Grid.Column="0"    
                                            Focusable="False"
                                            Background="#FFFFFFFF"
                                            BorderThickness="0,0,0,0"
                                            DockPanel.Dock="Left"
                                            />
                                <!--ItemsPanel="{StaticResource BreadcrumbPanel}"-->

                                <!--<ContentPresenter x:Name="PART_View"
                                            Grid.Column="1" 
                                            Content="{Binding RootItem,RelativeSource={RelativeSource TemplatedParent}}"/>-->

                                <ItemsControl x:Name="PART_View"
                                            Grid.Column="1"
                                            Grid.ColumnSpan="3"
                                            ItemsSource="{Binding Path=Items, RelativeSource={RelativeSource AncestorType={x:Type Controls:BreadcrumbBar}}}" >

                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>

                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>

                                            <ComboBox SelectedValue="{Binding Path=., Mode=OneTime}" ItemsSource="{Binding Path=Parent, Mode=OneTime}" MinWidth="0" />

                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>

                                </ItemsControl>

                                <ToggleButton x:Name="PART_FootSuggest"
                                            Grid.Column="2"
                                            Focusable="False"
                                            Background="#FFFFFFFF"
                                            BorderThickness="0,0,0,0"
                                            />
                                <!--ItemsPanel="{StaticResource BreadcrumbPanel}"-->

                                <Button x:Name="PART_FootRefresh"
                                            Grid.Column="3"
                                            Focusable="False"
                                            Background="#FFFFFFFF"
                                            BorderThickness="0,0,0,0"
                                            />
                                <!--ItemsPanel="{StaticResource BreadcrumbPanel}"-->

                            </Grid>
                        </Border>
                    </Border>



                    <!--<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type Views:PathTextBlock}}}">
                                <TextBox
                                    Text="{Binding Path=Path.ParsingName, Mode=OneWay}" 
                                    HorizontalAlignment="Stretch" 
                                    VerticalAlignment="Stretch" 
                                    Background="Green"
                                    />
                                
                                <ItemsControl ItemsSource="{Binding Path=Folders}">
                                    <ItemsControl.Template>
                                        <ControlTemplate TargetType="{x:Type ItemsControl}">
                                            <Border Name="Border"
                                                CornerRadius="2"
                                                Padding="0"
                                                BorderThickness="1"
                                                 >

                                                <Border.Background>
                                                    <SolidColorBrush Color="{StaticResource ControlLightColor}" />
                                                </Border.Background>
                                                <Border.BorderBrush>
                                                    <SolidColorBrush Color="{StaticResource BorderMediumColor}" />
                                                </Border.BorderBrush>
                                                <ItemsPresenter/>
                                            </Border>
                                        </ControlTemplate>
                                    </ItemsControl.Template>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <ComboBox SelectedValue="{Binding Path=., Mode=OneWay}" ItemsSource="{Binding Path=Parent, Mode=OneWay}" MinWidth="0"  />
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </Grid>-->

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>